wayland: Check transient loop
authorOlivier Fourdan <ofourdan@redhat.com>
Mon, 14 Dec 2015 15:34:00 +0000 (16:34 +0100)
committerOlivier Fourdan <ofourdan@redhat.com>
Wed, 16 Dec 2015 13:11:11 +0000 (14:11 +0100)
commitb456db8cf4c8c7d52d4a5c90948bd659b0716de6
treecfd01c53cbde14a4bc4d43cd812e3d6db24dc8ad
parent0b191974935d7d24b59f9cb4083c1221b36be2bd
wayland: Check transient loop

Gdk Wayland backend walks up the transient windows tree, but does not
check for cycles when doing so.

As a result, if two or more windows are transient to each other, the
Wayland gdk backend will enter an infinite loop.

While this is clearly a bug in the application, gtk+/gdk should be more
robust and handle such errors more gracefully.

To avoid looping infinitely at various point in the code, check for a
possible loop when setting the transient relationship and deny the
request to set a window transient for another if that would create a
loop.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=759299
gdk/wayland/gdkwindow-wayland.c